<template>
  <div class="app-container">
    <!--工具栏-->
    <div class="head-container">
        <el-form size="small" label-width="100px" :rules="rules" ref="form" :model="crud.order"
                 :disabled="crud.order.orderStatus==='PASS'">
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="单据编码">
                <el-input  style="width: 100%;" v-model="crud.order.code" disabled placeholder="系统自动生成"></el-input>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="协议状态">
                <el-select
                  v-model="crud.order.orderStatus"
                  class="filter-item"
                  clearable
                  disabled
                  placeholder="协议状态"
                  size="small"
                  style="width: 100%;"
                >
                  <el-option
                    v-for="item in dict.common_order_status"
                    :key="item.id"
                    :label="item.label"
                    :value="item.value"
                  />
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="业务日期">
                <el-date-picker
                  v-model="crud.order.createTime"
                  type="date"
                  :disabled="crud.order.orderStatus==='PASS'"
                  style="width: 100%;"
                  default-value
                  placeholder="系统自动生成">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="协议名称" prop="name">
                <el-input  v-model="crud.order.name" style="width: 100%;" :disabled="crud.order.orderStatus==='PASS'" placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="供应商" prop="customerId">
                <zSelect :value.sync="crud.order.customerId"  @getChange="getInfo" :disabled="crud.order.orderStatus==='PASS'" url="api/dropDown/basCustomerList" :params="{isContact:'1,2'}"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="采购部门" prop="deptId">
                <zSelect :value.sync="crud.order.deptId"  :disabled="crud.order.orderStatus==='PASS'" url="api/dropDown/childSysDeptList"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="采购员" prop="userId">
                <zSelect :value.sync="crud.order.userId"  :disabled="crud.order.orderStatus==='PASS'" url="api/dropDown/sysUserList" :params="{deptId:crud.order.deptId}"
                         style="width:  100%"/>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                <el-form-item label="联系人">
                  <el-input v-model="crud.order.contactName"  :disabled="crud.order.orderStatus==='PASS'" placeholder="请输入" />
                </el-form-item>
              </el-col>
          </el-row>
          <el-row :gutter="10">
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                <el-form-item label="联系电话">
                  <el-input v-model="crud.order.contactPhone"  :disabled="crud.order.orderStatus==='PASS'" placeholder="请输入" maxlength="11"  oninput="value=value.replace(/[^\d]/g,'')" show-word-limit/>
                </el-form-item>
              </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
                <el-form-item label="开始日期" prop="startDate">
                  <el-date-picker
                    v-model="crud.order.startDate"
                    type="date"
                    style="width: 100%;"
                    :disabled="crud.order.orderStatus==='PASS'"
                    default-value
                    format="yyyy - MM - dd "
                    value-format="yyyy-MM-dd"
                    placeholder="选择日期">
                  </el-date-picker>
                </el-form-item>
              </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="结束日期" prop="endDate">
                <el-date-picker
                  v-model="crud.order.endDate"
                  type="date"
                  style="width: 100%;"
                  default-value
                  :disabled="crud.order.orderStatus==='PASS'"
                  format="yyyy-MM-dd "
                  value-format="yyyy-MM-dd"
                  placeholder="选择日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :xs="24" :sm="12" :md="8" :lg="6" :xl="6">
              <el-form-item label="备注">
                <el-input  v-model="crud.order.remark"  :disabled="crud.order.orderStatus==='PASS'"  placeholder="请输入"></el-input>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
<!--   操作栏   -->
      <div >
        <el-button
          slot="left"
          class="filter-item"
          size="mini"
          type="primary"
          :disabled="crud.order.orderStatus==='PASS'"
          @click="toAdd()"
        >
          新增
        </el-button>
<!--        <el-button-->
<!--          slot="left"-->
<!--          class="filter-item"-->
<!--          size="mini"-->
<!--          type="success"-->
<!--          :disabled="crud.selections.length !== 1"-->
<!--          @click="toDeatil(crud.selections)"-->
<!--        >修改-->
<!--        </el-button>-->
      <el-button
        slot="right"
        class="filter-item"
        :disabled="crud.order.orderStatus==='PASS'"
        size="mini"
        type="primary"
        @click="submit()"
      >
        保存
      </el-button>
      <el-button
        slot="right"
        class="filter-item"
        size="mini"
        type="success"
        :disabled="$route.params.id=='null'"
        :loading="crud.passLoading"
        @click="crud.doDetailPassOrReject('PASS',id)"

      >
<!--        v-permission="permission.pass"-->
        审核
      </el-button>
      <el-button
        slot="right"
        class="filter-item"
        size="mini"
        type="info"
        :loading="crud.rejectLoading"
        :disabled="$route.params.id=='null'"
        @click="crud.doDetailPassOrReject('REJECT',id)"

      >
<!--        v-permission="permission.reject"-->
        反审
      </el-button>
      <el-button
          slot="right"
          class="filter-item"
          size="mini"
          type="primary"
          @click="toAddList"
          :loading="crud.rejectLoading"
        >
          批量新增
        </el-button>
    </div>
    <!--批量新增弹窗-->
      <el-dialog :close-on-click-modal="false" title="商品新增" :before-close="handleClose"
                 :visible.sync="showAddBatchDialog" append-to-body width="100vw">
        <add-batch v-if="showAddBatchDialog" :showAddBatchDialog.sync="showAddBatchDialog" :list="detailList" :params="{customerId:crud.order.customerId}"
                   @change="afterChangeGoods"></add-batch>
      </el-dialog>
      <el-table ref="table" stripe border height="500" v-loading="crud.loading" :row-class-name="crud.tableRowClassName"
                :data="crud.data"
                size="small" style="width: 100%;"
                :show-summary="true"
                sortable="custom"
                @sort-change="crud.sortChange"
                @selection-change="crud.selectionChangeHandler"
                @row-dblclick="crud.dbClick">
        <el-table-column :render-header="crud.renderHeader" type="selection" width="60" />
        <el-table-column :render-header="crud.renderHeader" type="index" width="60" label="序号"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsCode')" prop="goodsCode" label="商品编码" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsName')" prop="goodsName" label="商品名称" width="200">
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.goodsName }}</span>
            <jtg-select-plus v-else ref="productRef"
                             v-model="scope.row.goodsId"
                             :initValue="scope.row.goodsName"
                             typeName="BUY"
                             :customerId="crud.order.customerId"
                             @remoteMethod="getValue($event,scope.$index)"
                             @input="getInput($event,name,scope.$index)"
                             @change="crud.productChange($event,scope)"
                             url="productList"/>
          </template>
        </el-table-column>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('barcode')" prop="barcode" label="条形码" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('boxBarcode')" prop="boxBarcode" label="箱装条形码"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('helpSign')" prop="helpSign" label="助记符" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('model')" prop="model" label="规格型号" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsBrandCode')" prop="goodsBrandCode" label="商品品牌编码"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsBrandName')" prop="goodsBrandName" label="商品品牌名称"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsTypeCode')" prop="goodsTypeCode" label="商品分类编码"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsTypeName')" prop="goodsTypeName" label="商品分类名称"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsTagCode')" prop="goodsTagCode" label="商品类型编码"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('goodsTagName')" prop="goodsTagName" label="商品类型名称"/>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('taxPrice')" prop="taxPrice" label="含税单价" >
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.taxPrice }}</span>
            <el-input v-if="scope.row.isSelected"
                      @input.native="crud.inuptCount(scope, 'taxPrice')"
                      oninput="value=value.replace(/[^\d^\.]/g,'')"
                      maxlength="12"
                      v-model.lazy="scope.row.taxPrice"
                      style="width: 100%"/>
          </template>
        </el-table-column>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('noTaxBoxPrice')" prop="noTaxBoxPrice" label="未税箱价" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('noTaxPrice')" prop="noTaxPrice" label="未税单价" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('taxBoxPrice')" prop="taxBoxPrice" label="含税箱价" >
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.taxBoxPrice }}</span>
            <el-input v-if="scope.row.isSelected"
                      @input.native="crud.inuptCount(scope, 'taxBoxPrice')"
                      oninput="value=value.replace(/[^\d^\.]/g,'')"
                      maxlength="12"
                      v-model.lazy="scope.row.taxBoxPrice"
                      style="width: 100%"/>
          </template>
        </el-table-column>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('taxRate')" prop="taxRate" label="税率" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('boxUnitCount')" prop="boxUnitCount" label="箱装量" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('effectGoodsCount')" prop="effectGoodsCount" label="生效数量" >
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.effectGoodsCount }}</span>
            <el-input v-if="scope.row.isSelected"
                      oninput="value=value.replace(/[^\d^\.]/g,'')"
                      maxlength="12"
                      v-model.lazy="scope.row.effectGoodsCount"
                      style="width: 100%"/>
          </template>
        </el-table-column>
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('cutOffGoodsCount')" prop="cutOffGoodsCount" label="截止数量" >
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.cutOffGoodsCount }}</span>
            <el-input v-if="scope.row.isSelected"
                      oninput="value=value.replace(/[^\d^\.]/g,'')"
                      maxlength="12"
                      v-model.lazy="scope.row.cutOffGoodsCount"
                      style="width: 100%"/>
          </template>
        </el-table-column>

        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('seq')" prop="seq" label="排序" />
        <el-table-column :render-header="crud.renderHeader" v-if="columns.visible('remark')" prop="remark" label="备注" width="200">
          <template slot-scope="scope">
            <span v-if="!scope.row.isSelected">{{ scope.row.remark }}</span>
            <el-input v-if="scope.row.isSelected"
                      type="textarea"
                      :rows="2"
                      v-model.lazy="scope.row.remark"
                      style="width: 100%"/>
          </template>
        </el-table-column>
<!--        v-permission="['admin','buyProtocolDetail:edit','buyProtocolDetail:del']"-->
        <el-table-column :render-header="crud.renderHeader"  label="操作" fixed="right" width="150px" align="center">
            <template slot-scope="scope">
<!--              <el-button-->
<!--                type="primary"-->
<!--                icon="el-icon-plus"-->
<!--                circle-->
<!--                v-if="(crud.data.length-1)==scope.$index"-->
<!--                :disabled="crud.order.orderStatus==='PASS'"-->
<!--                @click="crud.addRow(scope.$index)"></el-button>-->
<!--              v-if="crud.data.length!==1"-->
              <el-button
                slot="reference" class="el-icon-delete opration_icon_btn"
                :disabled="crud.order.orderStatus==='PASS'"
                style="border: none;width: auto;height: auto"
                @click="delAddRow(scope.$index)"></el-button>
            </template>
        </el-table-column>
      </el-table>
      <!--分页组件-->
      <pagination />
    </div>
  </div>
</template>

<script>
import crudBuyProtocol from '@/api/erp/buyProtocol'
import CRUD, { presenter, header, form, crud } from '@crud/crud'
import rrOperation from '@crud/RR.operation'
import crudOperation from '@crud/CRUD.operation'
import udOperation from '@crud/UD.operation'
import pagination from '@crud/Pagination'
import jtgSelectPlus from '@/components/select/JtgSelectPlus'
import { getCompany } from '@/api/system/company'
import {Notification} from "element-ui";
import addBatch from '@/components/addBatch/addBatch'
// crud交由presenter持有
const defaultCrud = CRUD({ title: '采购协议明细',
  params() {
    const href = location.href.split('/')
    return {
      id: href[href.length - 1] == 'add' ? 0 : href[href.length - 1],  page: 0, size: 999
    }
  },
  query:{
  sort:'t.seq,asc'
  },
 url: 'api/buyProtocol/detail', name:'buyProtocolDetail',sort: 'id,desc', crudMethod: { ...crudBuyProtocol }})
const defaultForm = { id: null, orderId: null, goodsId: null, goodsCode: null, goodsName: null, barcode: null, boxBarcode: null, helpSign: null, model: null, goodsBrandId: null, goodsBrandCode: null, goodsBrandName: null, goodsTypeId: null, goodsTypeCode: null, goodsTypeName: null, goodsTagId: null, goodsTagCode: null, goodsTagName: null, taxId: null, taxCode: null, taxName: null, taxRate: null, firstUnitId: null, firstUnitCode: null, firstUnitName: null, firstUnitCount: null, effectGoodsCount: null, cutOffGoodsCount: null, taxPrice: null, noTaxPrice: null, taxBoxPrice: null, noTaxBoxPrice: null, seq: null, remark: null, createUserId: null, createUserCode: null, createUserName: null, createTime: null, updateUserId: null, updateUserCode: null, updateUserName: null, updateTime: null }
export default {
  name: 'BuyProtocolDetail',
  components: { pagination, crudOperation, rrOperation, udOperation,jtgSelectPlus,addBatch},
  mixins: [presenter(defaultCrud), header(), form(defaultForm), crud()],
  dicts: ['common_order_status'],
  data() {
    return {
      id: null,
      saveFlag: false,
      showAddBatchDialog: false,
      permission: {
        add: ['admin', 'buyProtocolDetail:add'],
        edit: ['admin', 'buyProtocolDetail:edit'],
        del: ['admin', 'buyProtocolDetail:del'],
        import: ['admin', 'buyProtocolDetail:import'],
        export: ['admin', 'buyProtocolDetail:export'],
        copy: ['admin', 'buyProtocolDetail:copy'],
        upload: ['admin', 'buyProtocolDetail:upload'],
        download: ['admin', 'buyProtocolDetail:download'],
      },
      rules: {
        endDate: [
          { required: true, message: '结束日期不能为空', trigger: 'blur' }
        ],
        startDate: [
          { required: true, message: '开始日期不能为空', trigger: 'blur' }
        ],
        contactName: [
          { required: true, message: '联系人不能为空', trigger: 'blur' }
        ],
        customerId: [
          { required: true, message: '供应商不能为空', trigger: 'blur' }
        ],
        userId: [
          { required: true, message: '业务员不能为空', trigger: 'blur' }
        ],
        name: [
          { required: true, message: '协议不能为空', trigger: 'blur' }
        ],
      },
      addRowData:{
        isSelected: true,id: null, orderId: null, goodsId: null, goodsCode: null, goodsName: null, barcode: null, boxBarcode: null, helpSign: null, model: null, goodsBrandId: null, goodsBrandCode: null, goodsBrandName: null, goodsTypeId: null, goodsTypeCode: null, goodsTypeName: null, goodsTagId: null, goodsTagCode: null, goodsTagName: null, taxId: null, taxCode: null, taxName: null, taxRate: null, firstUnitId: null, firstUnitCode: null, firstUnitName: null, firstUnitCount: null, effectGoodsCount: null, cutOffGoodsCount: null, taxPrice: null, noTaxPrice: null, taxBoxPrice: null, noTaxBoxPrice: null, seq: null, remark: null, createUserId: null, createUserCode: null, createUserName: null, createTime: null, updateUserId: null, updateUserCode: null, updateUserName: null, updateTime: null
      },
      productList:[]

    }
  },
  watch: {
  },
  destroyed() {
    this.crud.setItemInfo("buyProtocolDetail_add")
  },
  created(){
    if (this.$route.params.id == 'add') {
      if( this.crud.getItemInfo("buyProtocolDetail_add")){
        return false
      }
        this.crud.order = {
          id: null,
          code: '',
          createTime: this.getTime(),
          name: '',
          userId: '',
          orderStatus: 'SAVE',
          index: '0',
          buyChannel: null,
          customerId: '',
          contactName: '',
          contactPhone: '',
          startDate: null,
          endDate: null,
          remark: ''
        }
      }
  },
  beforeUpdate() {
    if (this.$route.params.id != 'add') {
      this.id = this.$route.params.id
      this.crud.order.id = this.id
    }
  },
  updated() {
    this.$nextTick(() => {
      this.$refs.table.doLayout()
    })
  },
  methods: {
    toAddList() {
      this.$refs['form'].validate((valid) => {
        if (valid) {
          //校验通过
          this.showAddBatchDialog = true
        } else {
          if (!this.crud.order.customerId) {
            this.$message.error("请先选择客户")
          }
        }
      })
    },
    handleClose() {
      this.showAddBatchDialog =false
    },
    afterChangeGoods(goods) {
      this.showAddBatchDialog = false
      goods.forEach(good => {
        good.isSelected = true
        this.crud.data.push(good)
      })
    },
    getInfo(e){
       this.crud.order.contactPhone = e.contactPhone
      this.crud.order.contactName = e.contactName
      this.crud.order.deptId = e.deptId
      this.crud.order.userId = e.userId
      console.log('getInfo',e)
    },
    getTime(date = new Date()){
      var y = date.getFullYear();
      var m = date.getMonth() + 1;
      m = m < 10 ? ('0' + m) : m;
      var d = date.getDate();
      d = d < 10 ? ('0' + d) : d;
      var h = date.getHours();
      h=h < 10 ? ('0' + h) : h;
      var minute = date.getMinutes();
      minute = minute < 10 ? ('0' + minute) : minute;
      var second=date.getSeconds();
      second=second < 10 ? ('0' + second) : second;
      // +' '+h+':'+minute+':'+second;
      return y + '-' + m + '-' + d+' '+h+':'+minute+':'+second
    },
    delAddRow(i){
      if(this.$route.params.id !== 'add'){
        this.$confirm('此操作将直接删除此条产品记录, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.crud.delRow(i)
          this.$message({
            type: 'success',
            message: '删除成功!'
          });
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      }else{
        this.crud.delRow(i)
      }
    },
    getValue(e,i){
      console.log('this.crud.data',this.crud.data )
      this.crud.data[i].productName = e
      // let temp = this.crud.data[2]
      // this.crud.data[3] = temp
      this.crud.data.map(item => {
        // item.existId = 0
        // item.existNum = 0
        if(item.existBox === null){
          item.existBox = 0
        }
        if(item.occupyBox === null){
          item.occupyBox = 0
        }
      })
    },
    getInput(e,name,i){
      console.log(',data.goodsName',e,name,i)
      if(this.crud.data){
        if(e){
          this.crud.data[i].goodsName = ''
          this.crud.data[i].goodsId= e
        }else{
          this.crud.data[i].goodsName = ''
          this.crud.data[i].goodsId= null
        }
      }
    },
    // 保存
    submit(){
      var oDate1 = new Date(this.crud.order.startDate);
      var oDate2 = new Date(this.crud.order.endDate);
      if(oDate1.getTime() > oDate2.getTime()){
        console.log('第一个大');
        this.$message({
          message: '开始日期不能大于结束日期',
          type: 'warning'
        })
        this.crud.order.startDate = null
        this.crud.order.endDate = null
        return false
      }
      this.$refs['form'].validate(valid => {
        if (!valid) {
          return
        }
        const table_rules = [
          // {name: '商品名称', value: 'goodsName'},
          {name: '含税单价', value: 'taxPrice'},
          {name: '未税单价', value: 'noTaxPrice'},
          {name: '生效数量', value: 'effectGoodsCount'},
          {name: '截止数量', value: 'cutOffGoodsCount'}
        ]
        const result = table_rules.some(({name, value}) => {
          const rules = this.$refs.table.data.some((item, index) => {
            if (!this.tableRules((index + 1), name, item[value])) return true
          })
          if (rules) return true
        })
        if (!result) this.save()
      })
    },
    tableRules(index, name, value) {
      if (!value) {
        Notification.error({title: '序号【' + index + '】' + name + '不能为空'})
        return false
      } else return true
    },
    //保存
    save() {
      let that = this
      that.crud.loadingOpen()
      this.crud.order.detailList  = this.crud.data
      let params = this.crud.order
      crudBuyProtocol.add(params).then(res => {
        if(res.success){
          this.crud.order  = res.data
          // this.crud.data = res.data.detailList
          let id=res.data.id
          if(this.$route.params.id == 'add'){
            this.$store.dispatch("tagsView/delView", this.$route);
            this.$router.push({params: {id}})
            this.crud.cleanItemInfo('buyProtocolDetail_add')
          }
          this.$message({
            message: '保存成功',
            type: 'success'
          })
          that.crud.loadingClose()
        }else{
          that.crud.loadingClose()
          this.$message({
            message: res.msg,
            type: 'warning'
          })
        }

      }).catch((res)=>{
        that.crud.loadingClose()
      })
    },
    // 新增
    toAdd(){
      if(!this.crud.order.customerId){
        this.$message({
          message: '请先选择供应商',
          type: 'error'
        })
        return
      }
      this.crud.data.push({
        isSelected: true,id: null, orderId: null, goodsId: null, goodsCode: null, goodsName: null, barcode: null, boxBarcode: null, helpSign: null, model: null, goodsBrandId: null, goodsBrandCode: null, goodsBrandName: null, goodsTypeId: null, goodsTypeCode: null, goodsTypeName: null, goodsTagId: null, goodsTagCode: null, goodsTagName: null, taxId: null, taxCode: null, taxName: null, taxRate: null, firstUnitId: null, firstUnitCode: null, firstUnitName: null, firstUnitCount: null, effectGoodsCount: null, cutOffGoodsCount: null, taxPrice: null, noTaxPrice: null, taxBoxPrice: null, noTaxBoxPrice: null, seq: null, remark: null, createUserId: null, createUserCode: null, createUserName: null, createTime: null, updateUserId: null, updateUserCode: null, updateUserName: null, updateTime: null
      })
    },
    //修改
    toDetail(){
    },
    // 获取数据前设置好接口地址
    [CRUD.HOOK.beforeRefresh]() {
      return true
    }, // 新增与编辑前做的操作
    [CRUD.HOOK.afterToCU](crud, form) {
    },

  }
}
</script>

<style scoped>
  .table-img {
    display: inline-block;
    text-align: center;
    background: #ccc;
    color: #fff;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
    vertical-align: middle;
    width: 32px;
    height: 32px;
    line-height: 32px;
  }
</style>
